export const jAlert3 = (msg: string, time = 2000) => {
  const msgLength = msg.length || 0
  if (msgLength > 20) {
    uni.showModal({
      title: '提示',
      content: msg,
      showCancel: false
    })
  } else {
    uni.showToast({
      title: msg,
      icon: 'none',
      duration: time
    })
  }
}

export const ensureDecodeURIComponent = (url: string): string => {
  if (url.indexOf('%') > -1) {
    return ensureDecodeURIComponent(decodeURIComponent(url))
  }
  return url
}
